package com.xmy.cultivate.service;

import com.xmy.cultivate.entity.CourseScheduling;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xmy.cultivate.entity.Grade;
import com.xmy.cultivate.entity.RepairCourse;
import com.xmy.cultivate.entity.Student;
import org.springframework.scheduling.annotation.Async;
import org.springframework.transaction.annotation.Transactional;

import java.text.ParseException;
import java.time.LocalDate;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 排课表 服务类
 * </p>
 *
 * @author min
 * @since 2022-07-28
 */
public interface ICourseSchedulingService extends IService<CourseScheduling> {

    public abstract boolean saveTo(CourseScheduling courseScheduling) throws ParseException;

    public abstract List<Student> getStudentForSchedulingGrade(String gradeId,String schedulingDetailId,String studentName);

    //public abstract Integer autoScheduling(Long gradeId) throws ParseException;

    @Transactional
    Integer autoScheduling(Long gradeId, LocalDate startDateParam) throws ParseException;

    LocalDate getOpenDate(Grade grade);

    @Async("onlineAsync")
    void addOtherDate(Integer yearPart, Integer quarterNum, Integer lessonType, String startDateParam, String endDateParam) throws ParseException;

    @Transactional
    Integer autoSchedulingForDate(Long gradeId, LocalDate startDate, LocalDate endDate) throws ParseException;

    public abstract List<Map<String, Object>> getSchedulingTermA(Integer yearPart, Integer quarterNum, Long schoolId, Integer subjectsId, Integer lessonType, Integer sourseLeve, Long adminId);

    public abstract List<Map<String, Object>> getSchedulingTermB(Integer yearPart,Integer quarterNum,Long schoolId,Integer subjectsId,Integer lessonType,Integer sourseLeve,Long adminId);

    public abstract List<Map<String, Object>> getSchedulingVacation(Integer yearPart, Integer quarterNum, Long schoolId,Integer subjectsId,Integer lessonType,Integer sourseLeve,Long adminId);

    List<String> weekdayExcel(Integer yearPart, Integer quarterNum, Long schoolId, Integer subjectsId, Integer lessonType, Integer sourseLeve, Long adminId);
}
